<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterOrderAddUserOpenId extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        Schema::connection('mysqlOrderAll')->table('consumer_order', function (Blueprint $table) {
            $table->string('platformId', 50)->default('')->after('userId')->comment('订单 platformid');

            $table->index('platformId', 'idx_platformId');
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::connection('mysqlOrderAll')->table('consumer_order', function (Blueprint $table) {
            $table->dropIndex('platformId');
        });
    }
}
